package com.yxw.live_vod_boot.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.HashMap;
/**
 * 队列服务控制
 * @author jiaxu.huang
 * @date 2023-12-26
 */
@Data
@ApiModel(value="HostManagerJobVO", description="队列服务控制VO")
public class HostManagerJobVO implements Serializable ,Comparable<HostManagerJobVO>{
    private static final long serialVersionUID = 21901211110485L;
    @ApiModelProperty("服务器名称")
    private String serverHostName;
    @ApiModelProperty("服务器类别:master/slaver")
    private String serverType;
    @ApiModelProperty("服务器状态:0正常,1掉线(心跳时间超过20秒及判定为掉线)")
    private String serverState;
    @ApiModelProperty("首次登录时间")
    private String firstLoginTime;
    @ApiModelProperty("心跳更新时间")
    private String keepLiveTime;
    @ApiModelProperty("锁定状态:0正常,1被锁定")
    private String historyLockState;
    @ApiModelProperty("锁定该服务器的服务器")
    private String  lockServerHostName;
    public LinkedHashMap ConvertToLinkedHashMap()
    {
        LinkedHashMap<String,String> oHostManager = new LinkedHashMap();
        oHostManager.put("serverHostName", serverHostName);
        oHostManager.put("serverType", serverType);
        oHostManager.put("serverState", serverState);
        oHostManager.put("firstLoginTime", firstLoginTime);
        oHostManager.put("keepLiveTime", keepLiveTime);
        oHostManager.put("historyLockState", historyLockState);
        //oHostManager.put("lockServerHostName", lockServerHostName);
        return oHostManager;
    }
    public HashMap ConvertToHashMap()
    {
        HashMap<String,String> oHostManageHashMapr = new HashMap();
        oHostManageHashMapr.put("serverHostName", serverHostName);
        oHostManageHashMapr.put("serverType", serverType);
        oHostManageHashMapr.put("serverState", serverState);
        oHostManageHashMapr.put("firstLoginTime", firstLoginTime);
        oHostManageHashMapr.put("keepLiveTime", keepLiveTime);
        oHostManageHashMapr.put("historyLockState", historyLockState);
        return oHostManageHashMapr;
    }
    @Override
    public int compareTo(HostManagerJobVO arg0) {
        return serverHostName.compareTo(arg0.getServerHostName());      //这里定义你排序的规则。
    }     
}
